package com.pactera.madp.cp.controller.sidebar;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.common.core.util.R;
import com.pactera.madp.cp.api.vo.DistributedCustomerVO;
import com.pactera.madp.cp.service.AddCustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 批量邀请客户-侧边栏控制层
 *
 * @author zkd
 * @date 2022/5/12 14:17
 */
@RestController
@RequestMapping("/add-customer-wechat")
@Api(value = "addCustomerWechat", tags = "批量添加客户管理-侧边栏")
public class AddCustomerSidebarController {

    @Autowired
    private AddCustomerService addCustomerService;

    @GetMapping("/distributed-cust-page/{wxUserId}")
    @ApiOperation(value = "根据成员wxUserId获取下放的用户列表")
    public R<IPage<DistributedCustomerVO>> getDistributedCustPage(Page page, @PathVariable("wxUserId") String wxUserId, @RequestParam(name = "name",required = false) String name){
        return R.ok(addCustomerService.getDistributedCustPage(page,wxUserId,name)) ;
    }

}
